[GRASS-user] v.edit bus error

,

Hi there,

I am trying to edit a vector map using the command 'v.edit', however, it keeps
failing with a 'bus error' message.

The version I am running is 6.3.cvs (070623) which is available at
http://wwwamb.bologna.enea.it/forgrass/download.htm

Does any one is getting this error? Is there a tool to fill out a bug report?

I will describe the task I want to do via 'v.edit' just in case someone knows a
way around. I have a vector map with some areas having 2 categories in the same
layer (this was the result of overlapping areas in the Shapefile). I have to
leave each of these areas with only one category so I was using the following
command:

v.edit n tool=caldel cat=3117 id=49792

Thanks

Hazael

That's probably the same bug I just found in another module, and is present in v.edit also. Bug already filed, and it's in the process of being fixed.

On Aug 8, 2007, at 12:35 PM, Hazael Maldonado Torres wrote:

Hi there,

I am trying to edit a vector map using the command 'v.edit', however, it keeps
failing with a 'bus error' message.

The version I am running is 6.3.cvs (070623) which is available at
http://wwwamb.bologna.enea.it/forgrass/download.htm

Does any one is getting this error? Is there a tool to fill out a bug report?

I will describe the task I want to do via 'v.edit' just in case someone knows a
way around. I have a vector map with some areas having 2 categories in the same
layer (this was the result of overlapping areas in the Shapefile). I have to
leave each of these areas with only one category so I was using the following
command:

v.edit n tool=caldel cat=3117 id=49792

Thanks

Hazael

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"I ache, therefore I am. Or in my case - I am, therefore I ache."

- Marvin

Sorry, unfinished thought...

That's probably the same bug I just found in another module, and is present in v.edit also. Bug already filed, and it's in the process of being fixed in CVS.

I don't know when Lorenzo will update his Mac binaries, but I'll have my own updated as soon as it's fixed, if you're willing to switch to a slightly different Mac build.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"I ache, therefore I am. Or in my case - I am, therefore I ache."

- Marvin

William Kyngesburye wrote:

That's probably the same bug I just found in another module, and is
present in v.edit also. Bug already filed, and it's in the process
of being fixed in CVS.

Which one?

Note that this is a bus error, not a segfault. On PPC, the most common
reason for a bus error is unaligned access (e.g. trying to read a
32-bit word from a memory address which isn't a multiple of 4).

x86 allows unaligned access, so this kind of bug normally only gets
discovered on Macs.

--
Glynn Clements <glynn@gclements.plus.com>

Sorry, bus error and segfault are the same to me - it's broke. But thanks, this expands my understanding another bit :slight_smile:

On Aug 8, 2007, at 3:23 PM, Glynn Clements wrote:

William Kyngesburye wrote:

That's probably the same bug I just found in another module, and is
present in v.edit also. Bug already filed, and it's in the process
of being fixed in CVS.

Which one?

http://wald.intevation.org/tracker/?func=detail&atid=204&aid=455&group_id=21

I just changed all the NULLs to "", it's in CVS now. (for all those modules I found it in)

Note that this is a bus error, not a segfault. On PPC, the most common
reason for a bus error is unaligned access (e.g. trying to read a
32-bit word from a memory address which isn't a multiple of 4).

x86 allows unaligned access, so this kind of bug normally only gets
discovered on Macs.

Intel OSX. I don't know what the default alignment is for Intel OSX. The GCC manpage wasn't clear what the Intel defaults are for OSX (or it's clear in a complex way).

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Time is an illusion - lunchtime doubly so."

- Ford Prefect

William Kyngesburye wrote:

>> That's probably the same bug I just found in another module, and is
>> present in v.edit also. Bug already filed, and it's in the process
>> of being fixed in CVS.
>
> Which one?

http://wald.intevation.org/tracker/?func=detail&atid=204&aid=455&group_id=21

Not related.

> Note that this is a bus error, not a segfault. On PPC, the most common
> reason for a bus error is unaligned access (e.g. trying to read a
> 32-bit word from a memory address which isn't a multiple of 4).
>
> x86 allows unaligned access, so this kind of bug normally only gets
> discovered on Macs.

Intel OSX. I don't know what the default alignment is for Intel
OSX. The GCC manpage wasn't clear what the Intel defaults are for
OSX (or it's clear in a complex way).

Intel doesn't care about alignment; it will just read both words and
piece the value back together (a consequence of its 8-bit origins).

The link in the original message refers to PPC binaries.

I can't see anything obvious in v.edit itself, so tracking this down
depends upon someone providing a backtrace.

--
Glynn Clements <glynn@gclements.plus.com>

On Aug 8, 2007, at 6:10 PM, Glynn Clements wrote:

I can't see anything obvious in v.edit itself, so tracking this down
depends upon someone providing a backtrace.

Hazael, can you check Console.app for a crashlog for v.edit? It would be in ~/Library/Logs/CrashReporter in the log list.

http://wald.intevation.org/tracker/?func=detail&atid=204&aid=455&group_id=21

Not related.

If it's the null message causing the v.edit bus error, then it is, since I found a null message in v.edit, among others.

The link in the original message refers to PPC binaries.

It wasn't specified, just that they were OSX binaries (by referring to Lorenzo's). Though PPC, they could run on Intel OSX, by way of OSX's Rosetta.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Time is an illusion - lunchtime doubly so."

- Ford Prefect

Hi there,

Before answering the questions from William, I would like to mention that GRASS
is being run on an Intel Mac and that as far as I can tell (using the activity
monitor) it is the Intel binaries of GRASS that are being used (no Rosseta).

Hazael, can you check Console.app for a crashlog for v.edit? It would
be in ~/Library/Logs/CrashReporter in the log list.

There is nothing in the logs regarding the v.edit error message. I also tried at
/Library/Logs/CrashReporter

http://wald.intevation.org/tracker/?func=detail&atid=204&aid=455&group_id=21

Not related.

If it's the null message causing the v.edit bus error, then it is, since
I found a null message in v.edit, among others.

I have written an small program to test the G_message("") vs G_message(NULL) and
I can confirm that on Mac OS X 10.4.10 G_message(NULL) triggers a bus error. The
function responsible for the error is vsprintf(). I tried the same program on
another computer running Ubuntu Linux and both G_message("") vs G_message(NULL)
works perfectly fine.

The content of the test program is listed below which contains the function
G_message() whose content was taken from GRASS's source code.

#define MSG 0

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>

void
G_message (const char *msg,
                                ...);

int
main(int argc, char **argv)
{
    printf("Test for GRASS\n");

    G_message("test");
    printf("\n");
    G_message("");
    printf("\n");
    G_message(NULL);
    printf("\n");

    return EXIT_SUCCESS;
}

void
G_message (const char *msg,
                                ...)
{
    char buffer[2000]; /* G_asprintf does not work */
    va_list ap;

    va_start(ap, msg);
    vsprintf(buffer, msg, ap);
    va_end(ap);

    print_error(buffer,MSG);
}

Regards,

Hazael

On Aug 9, 2007, at 7:33 AM, Hazael Maldonado Torres wrote:

Hi there,

Before answering the questions from William, I would like to mention that GRASS
is being run on an Intel Mac and that as far as I can tell (using the activity
monitor) it is the Intel binaries of GRASS that are being used (no Rosseta).

I checked Lorenzo's binaries, and they're PPC only, at least the 6.3 CVS are. PPC processes appear as normal processes on Intel, the Rosetta translation is transparent. I don't see anything in Activity Monitor that will tell you the architecture of a process. It's probably because, by the time it's running as a process, Rosetta has translated it into Intel code.

Hazael, can you check Console.app for a crashlog for v.edit? It would
be in ~/Library/Logs/CrashReporter in the log list.

There is nothing in the logs regarding the v.edit error message. I also tried at
/Library/Logs/CrashReporter

Odd.

I guess if there is no verification that your v.edit problem failed because of the null messages, the thing to do is see if a new build with the null messages fixed works.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"History is an illusion caused by the passage of time, and time is an illusion caused by the passage of history."

- Hitchhiker's Guide to the Galaxy

Hazael Maldonado Torres wrote:

> If it's the null message causing the v.edit bus error, then it is, since
> I found a null message in v.edit, among others.

I have written an small program to test the G_message("") vs G_message(NULL) and
I can confirm that on Mac OS X 10.4.10 G_message(NULL) triggers a bus error.

Odd. In that case, it probably is the G_message(NULL).

--
Glynn Clements <glynn@gclements.plus.com>